/**
 * Created by alan on 2017/4/27.
 * 水库水情
 */
Ext.define('Admin.view.waterDispath.DdsDrRsvrController', {
	extend: 'Ext.app.ViewController',
	alias: 'controller.ddsDrRsvrController',

	//steps下一步
	check: function() {
		var ddsDrRsvrGrid = this.lookupReference('ddsDrRsvrGrid');
		var stcd = this.lookupReference('stcd').getValue();
		var store = ddsDrRsvrGrid.getStore();
		// var stNm = this.lookupReference('stNm').getValue();
		var startTm = this.lookupReference('startTm').getValue();
		var endTm = this.lookupReference('endTm').getValue();
		if(startTm > endTm) {
			Ext.Msg.alert('提示', '起始时间需要小于结束时间'); //这种方式非常常见的
			return;
		}
		store.getProxy().extraParams = {
			river: config.RIVER,
			stcd: stcd,
			startTm: (startTm == null ? startTm : Ext.Date.format(startTm, 'Y-m-d H:i:s')),
			endTm: (endTm == null ? endTm : Ext.Date.format(endTm, 'Y-m-d H:i:s'))
		};
		store.reload();
	},


})
